set(CMAKE_SYSTEM_NAME               Windows)
set(CMAKE_SYSTEM_PROCESSOR          x86_64)
set(CMAKE_ASM_COMPILER              x86_64-w64-mingw32-as)
set(CMAKE_C_COMPILER                x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER              x86_64-w64-mingw32-g++)
set(CMAKE_OBJCOPY                   x86_64-w64-mingw32-objcopy)
set(CMAKE_RANLIB                    x86_64-w64-mingw32-ranlib)
set(CMAKE_SIZE                      x86_64-w64-mingw32-size)
set(CMAKE_STRIP                     x86_64-w64-mingw32-strip)
execute_process(COMMAND uname OUTPUT_VARIABLE uname)
if (uname MATCHES "^MSYS" OR uname MATCHES "^MINGW")
	set(CMAKE_AR ar)
	set(CMAKE_LINKER ld)
	set(CMAKE_RC_COMPILER windres)
else()
	set(CMAKE_AR x86_64-w64-mingw32-ar)
	set(CMAKE_LINKER x86_64-w64-mingw32-ld)
	set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
endif()
set(CMAKE_EXE_LINKER_FLAGS          "-static -static-libgcc -static-libstdc++")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM     NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY     ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE     ONLY)